CREATE TABLE [dbo].[TTDOSE_CORR]
(
[TI_DOCU] [dbo].[TD_VC_003] NOT NULL,
[NU_SERI] [dbo].[TD_VC_010] NOT NULL,
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[ST_GENE_DOCU] [dbo].[TD_VC_001_SINO] NULL,
[NU_ULTI_CORR] [dbo].[TD_IN_001] NOT NULL CONSTRAINT [DF__TTDOSE_CO__NU_UL__27C3E46E] DEFAULT ((0)),
[NU_LINE] [dbo].[TD_SI_001] NOT NULL CONSTRAINT [DF__TTDOSE_CO__NU_LI__28B808A7] DEFAULT ((0)),
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NULL CONSTRAINT [DF__TTDOSE_CO__CO_US__29AC2CE0] DEFAULT (substring(suser_sname(),(1),(8))),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NULL CONSTRAINT [DF__TTDOSE_CO__FE_US__2AA05119] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NULL CONSTRAINT [DF__TTDOSE_CO__CO_US__2B947552] DEFAULT (substring(suser_sname(),(1),(8))),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NULL CONSTRAINT [DF__TTDOSE_CO__FE_US__2C88998B] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTDOSE_CORR] WITH NOCHECK ADD CONSTRAINT [CK__TTDOSE_CO__ST_GE__26CFC035] CHECK NOT FOR REPLICATION (([ST_GENE_DOCU]='N' OR [ST_GENE_DOCU]='S'))
GO
ALTER TABLE [dbo].[TTDOSE_CORR] ADD CONSTRAINT [PK__TTDOSE_C__FFDFEB8F53385258] PRIMARY KEY CLUSTERED  ([TI_DOCU], [NU_SERI], [CO_EMPR]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTDOSE_CORR] ADD CONSTRAINT [FK__TTDOSE_CORR__520F23F5] FOREIGN KEY ([TI_DOCU], [CO_EMPR]) REFERENCES [dbo].[TTDOCU_CORR] ([TI_DOCU], [CO_EMPR])
GO
GRANT SELECT ON  [dbo].[TTDOSE_CORR] TO [public]
GRANT INSERT ON  [dbo].[TTDOSE_CORR] TO [public]
GRANT DELETE ON  [dbo].[TTDOSE_CORR] TO [public]
GRANT UPDATE ON  [dbo].[TTDOSE_CORR] TO [public]
GO
